import { getAllCategory } from "../../apis/category";

export const allCategory = () => {
    return async (dispatch: any) => {
        // 调用 API，发送请求
        const res = await getAllCategory();

        // 将请求结果保存到状态机
        dispatch({ type: 'GET_CATEGORY', payload: res })

    }
}